#ifndef MESSAGEDIALOG_H_
#define MESSAGEDIALOG_H_
#include "ui_MessageDialog.h"

#include <QtGui>
#include <QtCore>
#include <cstdio>
#include "inboxListData.h"
#include "contactData.h"
#include "codec.h"
#include "controlMessageDialog.h"
#define WHEEL_STEP 10
class MessageWidget : public QWidget
{
	Q_OBJECT
	public:
		MessageWidget();
		MessageWidget(inboxListData *data, inboxListData *trushData, contactData *cdata, int index);
		~MessageWidget();
		virtual void mousePressEvent(QMouseEvent *e);
		virtual void mouseMoveEvent(QMouseEvent *e);
		virtual void mouseReleaseEvent(QMouseEvent *e);
		virtual void wheelEvent(QWheelEvent *e);
		void paintEvent(QPaintEvent *);
	private:
		inboxListData *mData;
		inboxListData *mTrushData;
		contactData *cData;
		int mIndex;
		messageList *mMessageList;
		QString contactName;
		int startY;
		int textHeight;
		QList<int> smsYList;
		QPoint mousePoint;
		bool mousePressed;
		bool mouseMoved;
		bool theFirstTime;
		void controlMessage(int index);
	signals:
		void quitWidget();
};

class MessageDialog : public QDialog
{
	public:
		MessageDialog(inboxListData *data, inboxListData *trushData, contactData *cdata, int index);
		~MessageDialog();
		Ui::Dialog myDialogUi;
		MessageWidget *contentWidget;
		//QWidget *contentWidget;
};


#endif /*MESSAGEDIALOG_H_ */

